package com.gong.DesignPattern.SingletonPattern.lanhanShi;

/**
 * @author GongChang
 * @version 1.0
 * @date 2021/6/7 0007 9:16
 */
public class Singleton1 {
    private String name = "zhangsan";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private Singleton1(){}

    private static class Singleton1Instanse{
        private static final Singleton1 s = new Singleton1();
    }

    public static Singleton1 getInstance(){
        return Singleton1Instanse.s;
    }
}
